package ace.module.upms.core.impl.manager;

import ace.cmp.data.spring.data.jdbc.querydsl.rsql.core.manager.DtoManager;
import ace.module.upms.api.model.dto.UpmsRoleDto;
import ace.module.upms.core.impl.dao.entity.UpmsRole;
import java.util.List;
import java.util.Map;

/**
 * 角色对象 spring data jdbc querydsl rsql manager.
 *
 * @author Caspar
 */
public interface UpmsRoleManager extends DtoManager<UpmsRole, Long, UpmsRoleDto> {

  Map<Long, List<UpmsRoleDto>> getAccountIdAndRoleMapByUpmsAppIdAndIamAccountIdIn(
      Long upmsAppId,
      List<Long> iamAccountIds);

  List<UpmsRoleDto> getByUpmsApIdAndIamAccountId(
      Long upmsAppId,
      Long iamAccountId);

  List<UpmsRole> getByUpmsAppIdAndIdInAndDeleteFlagIsFalse(Long upmsAppId, List<Long> ids);

  boolean anyMatch(List<UpmsRole> roles, Long upmsRoleId);
}